package ua.edu.sumdu.j2se.roman.lab1.controller;

import ua.edu.sumdu.j2se.roman.lab1.domain.Task;
import ua.edu.sumdu.j2se.roman.lab1.domain.TaskList;
import ua.edu.sumdu.j2se.roman.lab1.view.EnterCommandView;
import ua.edu.sumdu.j2se.roman.lab1.view.InformMassage;

import java.util.Date;

/**
 * Author: Radko Roman.
 */

/**
 * This interface provides some control methods.
 *
 */
public interface Controller {
    /**
     * This method marks event when become tasks date.
     *
     * @param tasks set of tasks
     */
    void tasksTimeBecomeEvent(TaskList tasks);

    /**
     * Starts when user enter add command and show specified view.
     * 
     */
    void chooseAddCommand();

    /**
     * Starts when user enter close command and show specified view.
     * 
     */
    void chooseCloseCommand();

    /**
     * Adds task to the list.
     * 
     * @param task  to be added
     */
    void addTask(Task task);


    void chooseListCommand();

    /**
     * Must ask user title of task which need to be removed, delete it, and inform user.
     *
     */
    void chooseDeleteCommand();

    /**
     * Deleted the task by title.
     *
     * @param title of the removing task
     * @return  true if task successfully deleted from the list
     */
    boolean deleteTask(String title);

    /**
     * Must do something when user decide to postpone task.
     *
     */
    void choosePostponeCommand(Task task);

    /**
     * On start view after postpone operation.
     *
     */
    void onPostponeViewClose();

    /**
     * Inform about entered command.
     *
     * @param command
     */
    void performAction(String command);

    /**
     * Creates new task with entered parameters.
     *
     * @param title
     * @param startTime
     */
    Task createNewTask(String title, Date startTime);

    /**
     * Postpone task, or close if user choose it.
     *
     * @param command
     * @param remindTask
     */
    void performRemindAction(String command, Task remindTask);

    /**
     * Postpone task for next time.
     *
     * @param task
     * @param nextTime
     */
    void postponeTask(Task task, Date nextTime);

    /**
     * Gets entered command by user from console.
     *
     * @return entered command
     */
    EnterCommandView getEnterCommandFromConsoleView();

    /**
     * Gets information massage from
     *
     * @return
     */
    InformMassage getInformMassage();
}
